﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Common.UI.Report.Views.Interfaces;

namespace Common.UI.Report
{
    /// <summary>
    /// Interaction logic for ReportView.xaml
    /// </summary>
    public partial class ReportView : UserControl, IReportView
    {
        public string Title
        {
            get;
            set;
        }

        public ReportView(IFilterView filterView, IListView listView)
        {
            InitializeComponent();

            this.filterContentControl.Content = filterView;
            this.listContentControl.Content = listView;
        }

        
        public void ShowFilter()
        {
            this.filterExpander.IsExpanded = true;
            this.listExpander.IsExpanded = true;
        }

        public void ShowList()
        {
            this.filterExpander.IsExpanded = true;
            this.listExpander.IsExpanded = true;
        }

        
        public void PrintReportView()
        {
            this.filterExpander.IsExpanded = true;
            this.listExpander.IsExpanded = true;

            PrintDialog printDialog = new PrintDialog();
            if (printDialog.ShowDialog() == true)
            {
                printDialog.PrintVisual(this, this.Title);
            }
            
        }
    }
}
